//
//  JMlistVideosCell.m
//  仿生物无忧
//
//  Created by 彭继宗 on 15/12/6.
//  Copyright © 2015年 彭继宗. All rights reserved.
//

#import "JMlistVideosCell.h"



@interface JMlistVideosCell ()

//视频图片
@property (weak, nonatomic) IBOutlet UIImageView *imgView;
//简介label
@property (weak, nonatomic) IBOutlet UILabel *detailLab;
//类型
@property (weak, nonatomic) IBOutlet UILabel *type;

//点赞数
@property (weak, nonatomic) IBOutlet UILabel *praiceNum;
//播放数
@property (weak, nonatomic) IBOutlet UILabel *playNum;

@end

@implementation JMlistVideosCell


/**
 *
 //视频名字
 @property (nonatomic, copy) NSString *name;
 //视频id
 @property (nonatomic, copy) NSString *tmpId;
 //图片地址
 @property (nonatomic, copy) NSString *picUrl;
 //是否??
 @property (nonatomic, assign)BOOL price;
 //视频id
 @property (nonatomic, copy) NSString *id;
 //视频描述
 @property (nonatomic, copy) NSString *describe;
 //类型
 @property (nonatomic, copy) NSString *type;
 //点击
 @property (nonatomic, assign) int click;
 //??
 @property (nonatomic, assign) int up;

 */
- (void)prepareForSourse
{
    //设置图片
//
//    options:SDWebImageLowPriority | SDWebImageRetryFailed
    [self.imgView sd_setImageWithURL:[NSURL URLWithString:self.video.picUrl]];
    
    //设置描述
    self.detailLab.text = self.video.name;
    //设置类型
    if ([self.video.type isEqualToString:@"video"] )
    {
        self.type.text = @"视频";
    }
    else
    {
        self.type.text = @"教程";
    }
    
    //设置点赞数
    self.praiceNum.text = @(self.video.up).description;
    //设置播放数
    self.playNum.text = @(self.video.click).description;
}


#pragma mark- 设置数组
- (void)setVideo:(JMListVideos *)video
{
    _video = video;
    
    [self prepareForSourse];
}


@end
